﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ARS.Control.Custom.Entity.Forms
{
    public class UeditorForm:Form
    {
        protected override void RenderContents(System.Web.UI.HtmlTextWriter output)
        {
            base.RenderContents(output);

            StringBuilder sb = new StringBuilder();


            sb.Append("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/ueditor/ueditor.config.js\"></script>");
            sb.Append("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/ueditor/ueditor.all.js\"></script>");
            //sb.Append("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/ueditor/ueditor.all.min.js\"></script>");
            sb.Append("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/ueditor/lang/zh-cn/zh-cn.js\"></script>");

            // style=\"width:1024px;height:500px;\"
            sb.Append(string.Format("<script id=\"{0}\"  name=\"{0}\" style=\"width:100%;height:500px;\" type=\"text/plain\"></script><script type=\"text/javascript\">var ueObj = UE.getEditor('{0}');ueObj.addListener(\"ready\", function () {{ueObj.setContent('{1}');}})</script>", base.Field.Html_Control_Name, base.Field.Value));
            //sb.Append("");ueObj.setContent('123');

            output.Write(string.Format(base.GetTrHtml(),sb));
            //output.Write("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/ueditor/ueditor.config.js\"></script>");
            //output.Write("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/ueditor/ueditor.all.min.js\"></script>");
            //output.Write("<script type=\"text/javascript\" charset=\"utf-8\" src=\"/Scripts/ueditor/lang/zh-cn/zh-cn.js\"></script>");
            ////
            //output.Write("<script id=\"editor\" type=\"text/plain\" style=\"width:1024px;height:500px;\"></script>");


        }
    }
}
